require 'date'
#require 'parsedate'
require 'cgi'
require 'cgi/session'

#Encoding.default_external = 'UTF-8'

$class_dir = $dir + "class/"

$templete_dir = $class_dir + "tpl/"

load $class_dir + 'base/message_jp.rb'
load $class_dir + 'base/model.rb'
load $class_dir + 'base/view.rb'
load $class_dir + 'base/control.rb'
load $class_dir + 'base/dbconnect_sqlite3.rb'
load $class_dir + 'base/tools.rb'
load $class_dir + 'base/html.rb'

$cgi = CGI.new()

$_GET = {}
$_POST = {}
$_SESSION = {}

CGI::parse($cgi.query_string).each {|key, val|
  $_GET[key] = val.to_s
}

if $cgi.request_method == "POST" then
  $cgi.params.each {|key, val|
    $_POST[key] = val
  }
end

#$session = CGI::Session.new($cgi)
#$session.each {|key, val|
#  $_SESSION[key] = val
#}

$db = DBConnect.new($db_host, $db_user, $db_pass, $db_name)

